<?php
 /******************************************************************************
 *   GunCMS is an avid supporter of open source software. This is the appropriate 
 *   option if you are creating an open source application with a license 
 *   compatible with the GNU GPL license v3.
 *   For details http://www.gnu.org/licenses/gpl.html
 *   DO NOT USE FOR COMMERCIAL WITHOUT PERMISSION
 *
 * GunCMS Version 1.0.3
 * Copyright(c) 2009-2010, T & L GdbR
 * info@guncms.de
 * 
 * http://www.guncms.de
 ********************************************************************************/
class FgcmsPageBean {
	
	public function __construct() {
	// contructor function
	}
	
	//returns page by category_id
	public static function get_page_by_id($db,$id) {
    	$strSQL = sprintf("SELECT p.* FROM ".TBL_PAGE." p ".
				" LEFT JOIN ".TBL_PAGE2CAT." c ON c.page_id=p.page_id ".
				" LEFT JOIN ".TBL_CATEGORY." t ON t.cat_id=c.category_id ".
    			" WHERE c.category_id ='$id' AND t.cat_is_active = '1'");
    	return $db->get_row($strSQL);
    }
}
?>
